/*package pl.integration.jdbcconnector.dao;

import java.sql.Driver;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

import pl.integration.jdbcconnector.objects.Pracownik;

public class HibernateBaseDAO {

	private static SessionFactory sf;

	public static SessionFactory getInstance() {
		if (sf == null) {
			Configuration cfg = new Configuration();
			cfg.setProperty("hibernate.dialect", "pl.integration.jdbcconnector.SQLiteDialect");
			cfg.setProperty("hibernate.connection.driver_class", "org.sqlite.JDBC");
			cfg.setProperty("hibernate.connection.url",	"jdbc:sqlite:src/test/resources/database.db");
			cfg.setProperty("hibernate.hbm2ddl.auto", "update");
			
			cfg.addResource("hbms/Notatka.hbm.xml");
			cfg.addResource("hbms/Pracownik.hbm.xml");
			cfg.addResource("hbms/Komunikat.hbm.xml");
			cfg.addResource("hbms/Klasa.hbm.xml");
			cfg.addResource("hbms/Uczen.hbm.xml");
			cfg.addResource("hbms/Rodzic.hbm.xml");
			sf = cfg.buildSessionFactory();
		}
		return sf;
	}
		
	public static void saveObject(Object obj) {
		
		Session s = getInstance().openSession();
		try {
			Transaction tx = s.beginTransaction();
			try {
				s.save(obj);
				tx.commit();
				System.out.println("Object saved - " + obj.getClass().getSimpleName());
			} catch (Exception e) {
				tx.rollback();
				e.printStackTrace();
			}
		} finally {
			s.close();
		}
		
	}
	
	public static Object loadObject(Class clazz, int id){
		
		Session s = getInstance().openSession();
		Object obj = s.load(clazz, id);
		System.out.println("Object loaded - " + obj.getClass().getSimpleName());
		return obj;
	}

}
*/